package com.easy.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.text.SimpleDateFormat;
import java.util.Date;

@Data
public class FosterBean {
    private String pet_photo;
    private String user_id;
    private String pet_id;
    private String pet_name;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date foster_date;
    private String foster_state;
    private byte state;
    private int id;
    private UserBean userBean;

    private String user_name;

    public String getFoster_date(){
        if(foster_date==null) return null;
        return new SimpleDateFormat("YYYY-MM-dd").format(foster_date);
    }
}
